#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 5e4 + 5;

int n, m;
int c[N];
int l[255], r[255], bid[N];
void init() {
  int k = floor(sqrt(n));
  rep(i, 1, n) bid[i] = (i - 1) / k + 1;
  int bcnt = bid[n];
  rep(i, 1, bcnt) {
    l[i] = (i - 1) * k + 1;
    r[i] = i * k;
  }
  r[bcnt] = n;
}
struct Ask {
  int l, r, id;
  bool operator<(const Ask& o) const {
    if (bid[l] == bid[o.l]) {
      if (bid[l] & 1)
        return r < o.r;
      else
        return r > o.r;
    } else
      return l < o.l;
  }
} ask[N];
int L = 1, R = 0;
int cnt[N];
ll sum = 0;
using pll = pair<ll, ll>;
pll ans[N];
void add(int x) { sum += cnt[c[x]]++; }
void del(int x) { sum -= --cnt[c[x]]; }
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  rep(i, 1, n) cin >> c[i];
  rep(i, 1, m) cin >> ask[i].l >> ask[i].r;
  rep(i, 1, m) ask[i].id = i;
  sort(ask + 1, ask + m + 1);
  rep(i, 1, m) {
    while (R < ask[i].r) add(++R);
    while (R > ask[i].r) del(R--);
    while (L < ask[i].l) del(L++);
    while (L > ask[i].l) add(--L);
    ll x = sum;
    ll y = 1ll * (R + 1 - L) * (R - L) / 2;
    ll d = gcd(x, y);
    ans[ask[i].id] = pll(x / d, y / d);
  }
  rep(i, 1, m) cout << ans[i].first << '/' << ans[i].second << endl;
  return 0;
}